package factory.method;


public class Customer {
    public static void main(String[] args) {

        //工厂方法模式，虽代码量多，但是方便扩展，只需新增扩展类和对应的工厂类即可实现扩展
        BaoMa baoMa = new BaoMaFactory().getCar();
        DaBen daBen = new DaBenFactory().getCar();
        MoBai moBai = new MoBaiFactory().getCar();

        System.out.println("我买了辆"+moBai.getCarName());
        System.out.println("我买了辆"+daBen.getCarName());
        System.out.println("我买了辆"+baoMa.getCarName());

    }

}
